<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="rurple.css" type="text/css" />

<title>Summary of instructions</title>
</head>
<body>
<h2 class="title">Learning Python: Child's Play with RUR-PLE!</h2>
<h6>André Roberge, © 2005-2010</h6>

<h3 class="section">Summary of instructions</h3>

<p>Reeborg's actions</p>

<pre>
move()
turn_left()
pick_beeper()
put_beeper()
turn_off()
</pre>

<p>Tests:</p>

<pre>
front_is_clear()
left_is_clear()
right_is_clear()
facing_north()
carries_beepers()
on_beeper() <span class="comment"># equivalent to:</span> next_to_a_beeper()
</pre>

<p>Special built-in function:</p>

<pre>
repeat(function, number_of_times)
<span class="comment"># Note that this is equivalent to</span>
<span class="keyword">for</span> number <span class="keyword">in</span> range(number_of_times):
    function()
</pre>

<p>Object-oriented programming:</p>

<pre>
Reeborg = UsedRobot()
Reeborg.move()
Reeborg.turn_left()
Reeborg.pick_beeper()
Reeborg.put_beeper()
Reeborg.front_is_clear()
Reeborg.left_is_clear()
Reeborg.right_is_clear()
Reeborg.facing_north()
Reeborg.carries_beepers()
Reeborg.on_beeper() <span class="comment"># equivalent to:</span> Reeborg.next_to_a_beeper()
</pre>

<p>Advanced options:</p>

<pre>
set_trace_style(style=1, colour=<span class="string">'sea green'</span>)
<span class="comment"># Any colour name recognized by wxPython is acceptable</span>
<span class="comment"># style is one of [1, 2, 3, 4, 5]</span>
set_delay(time)
<span class="comment"># 0 &lt; time &lt; 10 (in seconds)</span>

Reeborg = UsedRobot(avenues=1, streets=1, orient_key = <span class="string">'E'</span>,
                 beepers=0, name=<span class="string">'robot'</span>, colour=<span class="string">'grey'</span>)
<span class="comment"># orient_key is one of <span class="string">'E'</span> or <span class="string">'e'</span>, <span class="string">'W'</span> or <span class="string">'w'</span>, <span class="string">'S'</span> or <span class="string">'s'</span>, <span class="string">'N'</span> or <span class="string">'n'</span>.</span>

<span class="comment"># Available <b>robot</b> colours are: <span class="string">'yellow'</span>, 
# <span class="string">'blue'</span>, <span class="string">'light blue'</span>, <span class="string">'purple'</span> and <span class="string">'green'</span>.  
# Any other colour will result in the default (<span class="string">'grey'</span>) to be used.</span>

<span class="comment"># Note that a "serial number" may be appended to the
# robot's "name", so that each robot during an entire play/work session
# with rur-ple will have a unique name.</span>

Reeborg.set_trace_style(style=1, colour=<span class="string">'sea green'</span>) 
Reeborg.set_delay(time)
</pre>

<p>New and improved robot!</p>

<pre>
Guido = RefurbishedRobot()  <span class="comment"># inherits from UsedRobot</span>

<span class="comment"># Additional methods:</span>
Guido.turn_right()
Guido.left_clear()
Guido.right_clear()
Guido.facing_east()
Guido.facing_south()
Guido.facing_west()
Guido.roll_dice(n=6) <span class="comment"># random integer between 1 and n.</span>
</pre>

<h3 class="section"><a name="Acknowledgements" id=
"Acknowledgements"><b>Acknowledgements</b></a></h3>

<p>Without my children, Julien and Evelyne, this program would
never have been created. This program is dedicated to them, in
the hope that they will learn the basics of programming by having
fun with it. I must also thank Julien for having designed the
splash screen as well as the robot image used in the various
error dialogs.</p>

<p>I personally have learned much by writing this program - in
fact, I had known about Python only for a few months before I
embarked on this project and had not programmed for more years
than I care to admit. Of course, without the work done by the
Python and wxPython community, the learning curve for me would
have been much steeper and this program would not have been
possible. This program was inspired by Guido van Robot (GvR), a
Python-like implementation of Pattis' original Karel the Robot. I
have received very useful comments from the GvR team; in
particular, I would like to acknowledge the contribution of Stas
Zykiewicz, who taught me a great deal about wxPython, and never
tired of trying out buggy code I wrote until rur-ple became stable enough to
be used by others. Thanks Stas!</p>

<p>Many of the images for buttons have been adapted from the
Nuvola icon set, created by David Vignoni. I wish I could create
images as esthetically pleasing as Vignoni does.</p>

<p>Tony Payzant spent a fair bit of time proofreading earlier
versions of the lessons. Bob Gailer suggested some useful corrections as
well.</p>

<p>Luis Sureda provided a Spanish translation and made some
useful suggestions to simplify the code related to the language
selection.</p>

<p>Richard E. Brown provided some useful bug reports and suggestions so that rur-ple should now work properly under MacOS.</p>

<p>Andy Judkis used rur-ple with his students and made many suggestions for improvement; in many ways, he became a driving force behind this project.</p>

<div class="lessons_nav">
<a href="rur.htm"><img alt="home" src=
"../images/home.png" /></a>
</div>
</body>
</html>
